<body>
    <?php
    if (strlen($errMsg) > 0) {
        print "<div class='alert-box error'>";
        print "<strong>Error!</strong>";
        print "<p>";
        print $errMsg;
        print "</p>";
        print "</div>";
    }
    if (strlen($successMsg) > 0) {
        print "<div class='alert-box success'>";
        print "<strong>Success!</strong>";
        print "<p>";
        print $successMsg;
        print "</p>";
        print "</div>";
    }
    ?>
    <div id="container">
        <div id="mainContent">
            <div>
                <p><img src="/resources/img/logoBanner.png" alt="KAT Banner"/></p>
                <hr />
                <?php include 'navigation.php'; ?>
                <p> Welcome to the Kenosha Area Transit Application manager.</p>
            </div>
            <div>
                <form>
                    <p>Filter</p>
                    <p>
                       <input type="text" id="searchFilter" placeholder="Location, Day, or Time" />  <!-- <input type="reset" value="Clear"> -->
                    </p>
                </form>


            </div>
            
            <?php
            if ($_SESSION['realm'] != 'View') {
                echo "<div id='reducedResolution'>";
                include 'hiddenRouteBoxMin.php';
                print "Editing Route";
                print "<a href = '/index.php/kat/route'>";
                print "<input id = 'doneButton2' class='reducedSize right blue button' value=\"Done Editing\" name='done' type='submit'>";
                print "</a>";
                echo "</div>";
            }

            include 'pagination.php';
            ?> 
            
            <table id="minimalistTable" class="tableizer-table">
                <thead class="tableizer-firstrow">
                <th class="hidden">id</th>
                <th>Location</th>
                <th>Day</th>
                <th>Time</th>
                <th>Direction</th>
                </thead>
                <tbody id = "tableFilter"> 
                    <?php
                    if ($routeArray != '') {
                        foreach ($routeArray as $data) {
                            print "<tr class='clickable' onclick=\"populateAddRouteForm('{$data['_id']}','{$data['location']}','{$data['day']}','{$data['time']}','{$data['direction']}' );\">";
                            print "<td class='hidden'>{$data['_id']}</td>";
                            print "<td>{$data['location']}</td>";
                            print "<td>{$data['day']}</td>";
                            print "<td>{$data['time']}</td>";
                            print "<td>{$data['direction']}</td>";
                            print "</tr>";
                        }
                    }
                    ?>
                </tbody>
            </table>
            </div> <!-- Closes pagination div -->
        </div>
    </div>
   
    <div id="sideContent">
        <?php
        if ($_SESSION['realm'] != 'View') {
            echo "<div id='sticker' class = 'stick'>";
            include 'hiddenRouteBox.php';
            echo "</div>";
        }
        ?> 
         <?php 
        if(isset($_SESSION['mode'])){
            print " <div id='editSideContent'>";
            print "<div class='stick' id='editSticker'>";
            print "<form action = '/index.php/kat/route' method = 'POST'>";
            print "<p><strong>Route $_POST[routenumber]</strong></p>";
            print "<hr />";
            print "<p>You are editing Route $_POST[routenumber]</p>";
            print "<input id = 'doneButton' class='reducedSize right blue button' value=\"Done Editing\" name='done' type='submit'>";
            print "</form>";
            print "</div>";
            print "</div>";
        }
        ?>
                
   
    </div> 
    <div class="clear"></div>

<script>
    (function($) {
        $('#pagination').simplePagination();
    })(jQuery);
</script>
</body>

<div id="site-footer">Kenosha Area Transit Manager developed by UW-Parkside 2014</div>